package com.hphs.service;

import com.hphs.dao.ProductDao;
import com.hphs.model.Product;
import com.hphs.model.ProductQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductService {

    //要对 数据进行业务逻辑编辑 所以需要引入dao
    @Autowired
    private ProductDao productDao;
    //处理业务逻辑
    public List<Product> findAll(){
        List<Product> productList = productDao.findAll();
        return productList;
    }
    // 处理包含的查询数据
    public List<Product> select(ProductQuery query){
        List<Product> productList = productDao.select(query);
        return productList;
    }

}
